package org.fireflow2.designer.eclipse.commands.connection;

import org.eclipse.draw2d.Bendpoint;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.commands.Command;
import org.fireflow2.designer.eclipse.modelwrapper.ConnectorWrapper;

public class RemoveBendPointCommand extends Command {
	ConnectorWrapper model;
	Bendpoint point;
	int index;

	public RemoveBendPointCommand(ConnectorWrapper model, Point point,
			int index) {
		super();
		this.model = model;
//		this.point = new AbsoluteBendpoint(newPoint);
		this.index = index;
	}
	
	@Override
	public void execute() {
		point = model.removeConstraint(index);
	}

	@Override
	public void undo() {
		model.addConstraint(index, point);
	}
	
	public void redo(){
		point = model.removeConstraint(index);
	}
}
